Repository navigation
kafka, storage: optimize unit tests (#5368) - #5806
ti-chi-bot[bot] merged 2 commits into
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
@3AceShowHand This PR has conflicts, I have hold it. |
|
@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/test all |
|
Cherry-pick conflicts appear resolved; removing the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 3AceShowHand The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/unhold |
|
/test pull-cdc-mysql-integration-heavy |
|
@ti-chi-bot: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This is an automated cherry-pick of #5368
What problem does this PR solve?
Issue Number: close #5416
This PR keeps Kafka sink related unit tests easier to maintain by replacing bespoke mock implementations with GoMock generated mocks.
What is changed and how it works?
ClusterAdminClient,Factory,MetricsCollector,Admin, andSyncProducer.options_test.go: it models broker/topic config responses, topic creation, replication-factor policy, andmin.insync.replicaschecks needed by options tests.defaultPartitionNumwhere tests need the TiCDC default partition count, and name fake Kafka admin values as mock data instead of business defaults.scripts/generate-mock.shso the new Kafka mocks are regenerated bymake generate_mock.Check List
Tests
make generate_mockgo test --tags=intest ./pkg/sink/kafka ./downstreamadapter/sink/kafka ./downstreamadapter/sink/topicmanagerQuestions
Will it cause performance regression or break compatibility?
No. This PR only changes tests, generated mocks, and the mock generation script. No production behavior, config, protocol, or compatibility change is intended.
Do you need to update user documentation, design documentation or monitoring documentation?
No.
Release note